package com.itstudio.myforumsystem.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itstudio.myforumsystem.entity.Article;
import com.itstudio.myforumsystem.entity.Type;
import com.itstudio.myforumsystem.mapper.ArticleMapper;
import com.itstudio.myforumsystem.mapper.TypeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleService extends ServiceImpl<ArticleMapper, Article> implements IService<Article> {
@Autowired
private ArticleMapper articleMapper;
    public void updateReadCount(Integer id) {
        articleMapper.updateReadNum(id);
    }

    public List<Article> findUsersArticle(Integer id) {
       return articleMapper.findUsersArticleBynickname(id);
    }

    public List<Article> selectRecommandArticleLimitFive() {


        return articleMapper.selectRecommandArticleLimitFive();
    }

    public List<Article> selectCollectionArticle(Integer userid) {

        return articleMapper.selectCollectionArticle(userid);
    }
}
